Skip to content

feat(platform-objects): an organization sets the display decimal places of each standard unit of measure (ADR-0158 U6) - #37389

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-yzpuwp
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-yzpuwp

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Fixes #35498
Refs #35339

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 管理员在设置的「配置」下、「计量单位」下面多一个「标准单位设置」页,可以给千克、克、件等国际标准单位各设一个显示小数位(比如珠宝行把克设成 3 位,砂石场把千克设成 0 位);所有成员都能看到这些设置,别的组织看不到。
  • 这是「计量单位」第一期里你选的「组织可改,新开一处设置」那一项;数量按单位显示的卡片会读它,本改动本身还不改变任何页面上数字的显示。
  • 只有组织管理员能新增、修改或删除,删除即清除;每次改动都记审计;组织里还留着设置时不能删除该组织,要先删掉设置,和汇率一样;可以直接撤回,因为还没有地方读取它。
  • 需要你做的:无。

What changes

  • @objectstack/platform-objects: new organization-owned object sys_standard_unit_setting (ADR-0158 U6; Open item 10 option A), registered in the first manifest beside sys_unit.
    • code: text, max 3. A format rule admits exactly the STANDARD_UNITS codes in exact uppercase (STANDARD_UNIT_SETTING_CODE_PATTERN). Unique per organization, immutable after create.
    • decimal_places: 0 to 12, scale 0, required.
    • Field history on both columns. No tenancy opt-out, so organization_id is injected.
    • Setup → Configuration → Standard Unit Settings, directly under Units of Measure, with all eleven nav labels translated. The translation bundles are regenerated; the zh-CN object strings are translated.
  • @objectstack/plugin-security:
    • member_default reads it (read only).
    • organization_admin gets an explicit line: create, edit and delete. Clearing a setting is deleting its row.
  • @objectstack/spec: sys_standard_unit_setting joins PLATFORM_OBJECTS_BY_PACKAGE['platform-objects'].
  • @objectstack/cli:
    • The organization-ownership inventory lists the object as attributed.
    • The Setup nav count pin goes from 36 to 37.
  • scripts/platform-object-tenancy-census.json is regenerated.

Precedent: sys_unit.decimal_places. The setting follows the same concept as an org unit's own decimal places: range 0 to 12, field history, member read, organization-admin write. The settings-key route (ADR-0144 D4's localization.currency) was measured and not followed, for four reasons. It is one org-wide scalar. Members read it only through a server projection. Its audit keeps hashes, not values. A per-code map would need a new settings column kind. The area approved this on claim amendments 7178077326 and 7178144166.

Deviations from the first shape, all on the card (amendments 7178077326, 7178144166, 7179529249):

  • No reader in this PR (amendment 7178077326). The display card Units of measure R1: show a quantity with its unit label #35490 adds the reader with its first caller, and the ADR-0158 L4 clamp to the field's scale goes there. "A member can read them" is met by member_default read over the data API.
  • Clear = delete, not set-to-null (amendment 7178144166). An organization delete refuses DELETE_RESTRICTED while any organization-owned row remains. Only sys_unit is exempt, through the engine's own cascade. So a row with no delete would block the organization delete forever. This follows sys_exchange_rate's posture: an admin deletes the setting, then the organization delete goes through. Pinned below.

Why code is text plus a format rule, not a select. A select's option values are stored lowercase (kgm), while a unit code is stored in exact uppercase everywhere (U4). The rule's pattern is built from the STANDARD_UNITS keys, so a code the table gains is admitted with no second edit.

First files to read, by risk:

  1. packages/plugins/plugin-security/src/objects/default-permission-sets.ts: the two sys_standard_unit_setting lines.
  2. packages/platform-objects/src/system/sys-standard-unit-setting.object.ts: the format rule and the immutable-code rule.
  3. packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts: the tenancy posture it boots under.

Two-minute check: pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/default-permission-sets.standard-unit-setting.integration.test.ts prints 15 passed. It boots a real stack under the isolated tenancy posture. It shows each of these:

  • an admin and an owner set, change and clear a setting, each act landing in sys_audit_log with old and new values;
  • an admin changes and deletes a setting the owner created, and the owner one the admin created (the organization_admin line, no superuser bits);
  • a member reads, and is refused 403 PERMISSION_DENIED on every write;
  • another organization's setting is never read, changed or cleared;
  • a non-standard or lowercase code, an out-of-range value, a duplicate code and a changed code are each refused;
  • an organization delete refuses 409 DELETE_RESTRICTED naming this object, and succeeds once the setting is deleted.

Tests

Rework round 1 (L1 7180149059, contract record 7180135740), head 98cbc47602. S1: the changeset sentence and the object's docblock now state the posture the isolation holds under (isolated; single raises no wall, group walls by membership, ADR-0105 D1), and N1 says the display card #35490 will read the value. S2: new cases where an admin and an owner each change and delete a setting the other created, plus the effective-permission map (delete kept, no modifyAllRecords). Affected tests re-run: the real-stack suite 15 passed (15), the declaration suite 14 passed (14). Ablation of the organization_admin line to allowEdit: false, allowDelete: false turned 8 of 15 red, the new cross-creator cases among them; restored, with the blob equal to HEAD and git diff HEAD empty.

All readings below are on head 03e453e3, and the tree is byte-identical to the commit.

Package suites and typecheck (under the verify lock)
  • @objectstack/plugin-security, src/default-permission-sets.standard-unit-setting.integration.test.ts: Test Files 1 passed (1), Tests 12 passed (12).
  • @objectstack/platform-objects, full suite: Test Files 127 passed (127), Tests 2176 passed (2176). This includes the new sys-standard-unit-setting.object.test.ts.
  • @objectstack/cli unit layer, src/utils/organization-ownership-inventory.test.ts and test/connect-agent-both-halves-wire.pin.test.ts: Test Files 2 passed (2), Tests 28 passed (28). The CLI integration layer is left to CI.
  • @objectstack/spec, src/system/constants/platform-object-names.test.ts: Test Files 1 passed (1), Tests 14 passed (14).
  • Typecheck of platform-objects, plugin-security, cli and spec: run in one set -e batch that reached its last part, so each exited 0. platform-objects reports check:test-typecheck: OK.
  • The full plugin-security suite and test:repo are left to CI.
Ablation: the member read grant
  • node scripts/ablation-replace.mjs changed member_default's sys_standard_unit_setting line to allowRead: false. Evidence: anchor x1 → x0, blob d4a112e3 → 87691407.
  • The suite went 2 failed | 10 passed. The member read test and the cross-organization read test both failed with PermissionDeniedError.
  • Restored: the blob equals HEAD (d4a112e3) and git diff HEAD is empty.

Acceptance notes

  • The cross-organization pins need the isolated posture. Under the default single posture no tenant wall stands, so another organization's row is visible. That is ADR-0105 D1's design, and every organization-owned object behaves the same way. The suite registers tenancy: { posture: 'isolated' }, as a deployment with organizations runs. The first run without it showed the other organization's row, which is how this was found. The sys_unit suite pins no cross-organization read.
  • External members get no read, the same as sys_unit. The display card Units of measure R1: show a quantity with its unit label #35490 already owes what an external member sees (comment 7030066814).
  • No ADR text in this diff. The ADR-0158 amendment (U3, U6 and L4 notes, and the Open item 10 answer) is drafted in the card report; the area lands it as row 7179515770 on the weekly ADR revisions card ADR revisions, week of 2026-11-25: rolling checklist of ADR text out of step with main (one governed PR) #37245 after this PR merges.
  • Locale fill. zh-CN carries translated object strings. The other nine locales carry the generator's English fill; nav labels are translated in all eleven.

Verification

Derived gate families (106 families, 212 commands) and the --ran reconciliation
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 212 commands from the tree at 03e453e3. Each was run, with its exit code captured before any pipe.
  • 211 exited 0. Five of those first exited 3 because a build prerequisite was missing: check-plugin-teardown-shape --self-test needed an unshallowed clone, and check:skill-examples, check:dual-build-cjs-loads, check:i18n-coverage and check:published-readme-exports needed a full build. All five exited 0 after git fetch --unshallow and a full turbo build (122 of 122 tasks).
  • pnpm check:platform-checklist exited 1 on one problem: areas/automation.json cites FlowItemMoreMenu.tsx#FlowItemMoreMenu, a symbol the ui/ file no longer declares. That is the base tree's own state: this diff touches neither ui/ nor docs/qa/, and the cited file is the same on origin/main.
  • --ran printed: "106 derived famil(ies) accounted for — 106 run, 0 NOT-MEASURED (a DERIVED zero — all 106 recorded an exit code and none of them is 3)".
Overlap check
Not measured locally
  • The CLI integration layer, test:repo, the full plugin-security suite and the repo-wide lint are left to CI.
  • Dogfood: n/a. The title has no !, and Clause-② is a widening.

🤖 Generated with Claude Code

Generated by Claude Code

…display decimal places for a standard unit code (WIP)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
… rule, real-stack grants suite, regenerated bundles and census

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/cli, @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/spec, touching 43 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

59 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f.

⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: isSystem (5 routes)
  • 9 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 189 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9fc252d3b42e5188c4310a693e07ea4ca01e115e — the merge of head 98cbc476025ff17adedde53e62f0cb8bcdbba110 into base ff6f9768d2969c4f2f42819f461424965238e30f, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9fc252d3b42e5188c4310a693e07ea4ca01e115e && git checkout 9fc252d3b42e5188c4310a693e07ea4ca01e115e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ff6f9768d2969c4f2f42819f461424965238e30f 98cbc476025ff17adedde53e62f0cb8bcdbba110 && git checkout -B drift-repro ff6f9768d2969c4f2f42819f461424965238e30f && git merge --no-ff 98cbc476025ff17adedde53e62f0cb8bcdbba110

node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ff6f9768d2969c4f2f42819f461424965238e30f → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Final head: 03e453e3d3076da4777dd5c288232b81561ce9a2. All 73 check-runs on it have completed: 60 success and 13 skipped (expected skips by path selection). None failed. The body now closes #35498. The ADR-0158 answer lands as row 7179515770 on #37245 after merge. Ready for L1 and the seat's contract review (Clause-② yes).


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 03e453e · 2026-11-26T01:41Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 03e453e3d3076da4777dd5c288232b81561ce9a2
Local-runs: none
Scope: packages/spec/src/system/constants/platform-object-names.ts + packages/platform-objects/src/system/sys-standard-unit-setting.object.ts, packages/platform-objects/src/system/sys-standard-unit-setting.object.test.ts, packages/platform-objects/src/system/index.ts, packages/platform-objects/src/plugin.ts, packages/platform-objects/src/apps/setup-nav.contributions.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts, packages/cli/src/utils/organization-ownership-inventory.ts, packages/cli/test/connect-agent-both-halves-wire.pin.test.ts, scripts/platform-object-tenancy-census.json, .changeset/35498-standard-unit-setting.md (translation bundles spot-checked: zh-CN objects, de hashes, the eleven nav labels, bundle-ownership.test.ts)
Security-touching: yes
Rule-change-verified: none

① Derived judgments

Read: card #35498 (body, every comment; amendments 7178077326, 7178144166, 7179529249), ruling record 7008551416 on #35339, ADR-0158 (U3, U6, L4, Open item 10) on main, the ADR row 7179515770 on #37245, the PR body, the net diff, and the check-runs on the head (every run success or skipped; on the names that ran twice, Check Changeset and PR-body guards are success on the newer run, Auto Label and Check PR Size are skipped on the newer run; Test Core, TypeScript Type Check, Lint & Repo Gates, Governed Surface Queue Guard, Spec property liveness all success).

  • PLATFORM_OBJECTS_BY_PACKAGE['platform-objects'] gains sys_standard_unit_setting (the one hits path). Right: add-only, in sort order, and it is what the reference lints and the catalog read, so the name becomes a reference target a nav entry or lookup may name. A widening of the public surface, nothing removed or re-meant.
  • New platform object, accept set. code text, max 3, admitted by an anchored, case-sensitive pattern built from Object.keys(STANDARD_UNITS); decimal_places required, 0..UNIT_DECIMAL_PLACES_MAX (12), scale 0; unique code per organization; code immutable by an update-only cross_field rule in the same previous != null && … spelling sys_unit uses. Right against the precedent (sys_unit.decimal_places: same range, same constant, imported not re-spelled) and against L4 (a display default, nothing rounds at write; nothing in the diff touches a record write). The pattern is derived from the table, so a code U1 gains is admitted with no second edit: right.
  • code as text plus a format rule, not a select. Right, and declared (7179529249): a select would store kgm, U4 stores the code in exact uppercase. The unit test refuses kgm, Kgm, C62, EA, an org code, KGMX, a padded code and the empty string; the integration suite refuses BOX_12, kgm, EA at 400 on code.
  • Clear = delete; decimal_places required. Right as declared (7178144166, superseding 7178077326). The API serves delete (no apiMethods whitelist, unlike sys_unit); a deleted row frees nothing a stored record depends on, since the code stays standard. This is where the object deliberately leaves the sys_unit precedent, and the reason holds.
  • member_default: read only, no write bit, no row policy. Right for least privilege: the card's Done-when asks exactly this ("a member can read them"), the line carries all three write bits false, and an explicit line is the set's whole answer for its object. Pinned: member list returns exactly [['GRM', 3]]; member create, edit and delete are each 403 PERMISSION_DENIED with the stored row unchanged; the PR's ablation (allowRead: false) reddens the member-read and cross-organization-read tests.
  • organization_admin: explicit line, create/edit/delete, no superuser bits. Right, and it is a narrowing of what the set's '*' line would otherwise give (the wildcard carries viewAllRecords, modifyAllRecords, viewAllFields); the derived no-bypass variant inherits the line. Read against the code: effectiveSharingModel resolves an unset model on a platform object to public, and the owner-only floor is bound to org_member, so an administrator reaches every setting of the organization without the bits. Pinned for the creator's own rows only: see S2.
  • external_default: no line. Right as read (the set has no wildcard and no sys_standard_unit_setting entry, so the object is denied). Not pinned: N2.
  • Tenancy: no opt-out, organization_id injected, census in reach, inventory attribution with no anchors, same citation as sys_unit. Right. Census totals move 110→111 registered and 59→60 in reach, outOfReach unchanged: consistent.
  • Cross-organization isolation. Right under the isolated posture, with real positive controls: both organizations hold a GRM row (which also proves the unique key is per organization, not installation-wide); a member and an administrator see neither the other row by list nor by id; an update and a delete aimed at the other row leave it byte-for-byte as stored. The wall is a posture property, not a property of this object: S1.
  • Organization delete. Right as pinned: 409 DELETE_RESTRICTED, dependentObject = this object, the organization still stored; then success once the row is deleted.
  • Setup nav entry, no requiredPermissions. Right: same reasoning as nav_units_of_measure directly above it (the object grant decides, Setup itself needs setup.access); the count pin moves 36→37 and names the entry; the unit test pins position and target view.
  • Clause-②: yes (widening). Right: a new object, two new grant lines, a new registry name and a new nav entry; nothing existing is refused or re-meant. Same declaration as sys_unit's own changeset (35488-standard-unit-table-sys-unit.md).
  • Metadata-protocol: none. Right: no key, accepted value, or metadata type an author writes is added, removed or re-meant; the object is organization runtime data. The registry name is a reference target, not a protocol key; sys_unit joined the same list under none, and the unit key itself (unitConfig, Units of measure R1: a number field declares its unit (unitConfig) and the write path checks the unit code #35489) is where added was declared.

② Semver level

patch on @objectstack/spec, @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/cli — right: each package has a source change, and AGENTS.md Post-Task step 3 gives a non-protocol widening patch. Both declaration lines are line-initial in the PR body and the changeset and agree. Check Changeset is success on its newer run.

Changeset, sentence by sentence:

  • Lead paragraph (admin sets per-code display decimals; one row per code; 0 to 12; delete clears; org units keep theirs on sys_unit): true.
  • "Every member reads … organization administrators and owners create, edit and delete … External members get no read": true (owner pinned; external read by reading only, N2).
    S1 (should-fix) — "organization_id is injected, so the tenant wall scopes every read and write; another organization's setting is never read" is stated without its condition, and is not true in every posture. ADR-0105 D1: single (the default) has no wall between organizations and no stamping; group walls by organization_id IN accessible_org_ids, so a person in two organizations reads both. The PR body's own acceptance note says the same ("Under the default single posture no tenant wall stands, so another organization's row is visible"). The behaviour is the platform's and is right; the shipped CHANGELOG sentence overclaims an isolation guarantee. Say it as it is: "where a tenant wall stands (isolated; group by membership), organization_id is stamped and the wall scopes every read and write". The same unconditional wording sits in the object's Tenancy docblock and the member_default comment, where it copies sys_unit's; fix the changeset, the comments may follow. I weighed this as must-fix (a false security sentence in a published file) and held it at should-fix because the code is correct, the precedent's wording is the same, and the changeset can still be corrected before the release PR consumes it.
  • "Every set, change and clear is written to sys_audit_log, with field history on both columns": true where plugin-audit is mounted; pinned with old and new values and tenant_id.
    N1 (nit) — "No reader ships in this change; the quantity display reads it": the second half is present tense for something that does not exist on this head. "The quantity display (Units of measure R1: show a quantity with its unit label #35490) will read it."
  • "Like an exchange rate … refused (DELETE_RESTRICTED) until its settings are deleted": true for this object as pinned; the exchange-rate half is read from the area's amendment, not re-derived here.

③ Boundary flags

Dev deviations (os-dev-report 7179477079), each answered:

  • Clear = delete: accepted, area amendment 7178144166; pinned.
  • code text plus format rule: accepted, 7179529249; pinned.
  • One file beyond the confirmed surface (connect-agent-both-halves-wire.pin.test.ts): accepted, 7179529249; it is a count pin the new entry moves, nothing else in the file changes.
  • Clause-②: yes (widening): right, ① above.
  • Refs then Fixes #35498: the PR body now says Fixes. Two of the card's Done-when lines are not true at merge: "Display (Units of measure R1: show a quantity with its unit label #35490) reads the setting" (deferred to Units of measure R1: show a quantity with its unit label #35490 by 7178077326) and "ADR-0158 records the answer" (row 7179515770 on ADR revisions, week of 2026-11-25: rolling checklist of ADR text out of step with main (one governed PR) #37245, unchecked, ordered after this merge). Both are tracked and the area accepted the close (7179529249).
    N4 (nit) — between this merge and the weekly ADR card, ADR-0158 on main still reads "have no home: Open item 10" and "a ruling is owed. Not settled here" while the tree and its docblocks cite Open item 10 as answered; the seat should not let row 7179515770 slip a week.
  • Commit trailer pair: no contract effect.

open_questions: empty. security_findings: none from the dev: I agree on the code; S1 is a wording finding and S2 a missing pin.

Out-of-scope finding the dev reported (pnpm check:platform-checklist red on main for FlowItemMoreMenu.tsx#FlowItemMoreMenu in areas/automation.json): not this diff; escalated to the seat to file or dedupe.

packages/spec/scripts/lib/platform-catalog.ts is on the amended file surface and is not in the diff. Right for now: the catalog is the app-facing subset with a "how the app reaches it" column, and nothing reaches this object until the reader ships. #35490 owes the row, or a decision that it stays out.

For #35490 (the reader), from this read: it must pick the row by the record's or the active organization, not "the row for the code". Under group a reader can see more than one organization's row for one code, and under single rows are unstamped. The L4 clamp to the field's scale is also still owed there; a stored 12 is legal here by design.

SQL push-down (Prime Directive 5): no query, id materialisation or in-app join is added; the uniqueness is a declared index and the isolation is Layer 0's predicate. Nothing to find.

④ Design judgment

packages/spec/src/system/constants/platform-object-names.ts — holds. One add-only name, registered by the package the map says owns it (com.objectstack.platform-objects, first manifest, beside sys_unit); the unit test pins the membership and the registering manifest.

Implementing files against the contract (ruling 7008551416: an organization admin may set the display decimals of any standard U1 code, in a new organization-owned setting place; L4 unchanged):

  • sys-standard-unit-setting.object.ts — agrees. Any U1 code, only U1 codes, organization-owned, a display default with no write-time effect. The settings-key route was measured and not followed for stated reasons (one org-wide scalar, projection-only member read, hash-only audit); the sys_* route gives per-code rows, value audit and a member read grant, which is what the card's Done-when asks.
  • default-permission-sets.ts — agrees, least privilege on both lines.
    S2 (should-fix) — the organization_admin comment claims "an administrator edits every setting of their organization without [the superuser bits]", and nothing pins it. In the suite each of carol and owen sets, changes and clears only a row they created themselves. The sys_unit suite pins exactly this for edit (default-permission-sets.unit-of-measure.integration.test.ts, "an administrator edits every unit of the organization, not only their own"), and here the line also carries delete, which sys_unit's does not, so the delete half has no precedent pin at all. By reading it holds (public OWD on a platform object; the owner_only_writes / owner_only_deletes floor binds org_member), but a line that deliberately drops modifyAllRecords should carry the pin: the owner changes and clears a setting the administrator created.
    N2 (nit) — "External members get no read" is asserted in the changeset, the PR body and the member_default comment and exercised by no persona in the suite.
    N3 (nit) — the cross-organization write test swallows both outcomes (a bare .catch returning nothing) and asserts stored state only. Enough for isolation; it leaves unpinned whether the caller meets a refusal or a silent no-op.
    N5 (nit) — nav_standard_unit_settings reuses the ruler icon of the entry directly above it.
  • organization-ownership-inventory.ts, platform-object-tenancy-census.json — agree with each other and with the object (in reach, organization_id, attribution, no anchors).
  • Integration test — real SecurityPlugin with the shipped sets, real object, real AuditPlugin, real caller resolution, isolated posture; the fixture-armed test asserts each persona's position, including that the administrator is not org_member. Refusals assert status, wire code and field, and that nothing was stored. Honest about its own limit: the posture it boots under is stated in the file and in the PR body.

No must-fix. S1 and S2 are owed, on this PR or a named follow-up, before the changeset is consumed by the release.

Implemented-by: claude/project-thread-yzpuwp
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 03e453e3d3
REWORK — L1, seat repo:objectstack#5: the two should-fix findings of contract record 7180135740 are fixed in this PR before landing; the rest of L1 reads clean.

  1. Shape: open draft against main. 48 files (+1255/−13), most of them generated bundles. Fixes #35498. l1-face CLEAN.
  2. Owed in this PR:
    • S1. The changeset says the tenant wall scopes every read and write and that another organization's setting is never read. That is true only under isolated: ADR-0105 D1 gives single no wall and group walls by membership. Give the sentence its posture condition, as the PR body's own acceptance note does. It is a security sentence, and it becomes a published changelog entry.
    • S2. The organization_admin line, and its claim that an administrator edits and deletes every setting of the organization, has no pin. Add a case where an admin updates and deletes a row another member created, mirroring the sys_unit suite's cross-creator edit.
      The same reviewer reads the delta.
  3. Gates: every check-run at 03e453e3d3 reads success or expected skip, 60 and 13; 0 failed.
  4. Accepted deviations:
    • (a) Clear-by-delete, the one departure from sys_unit (7178144166).
    • (b) Contract nits N1–N5. N1, the present-tense "the quantity display reads it", may be fixed alongside S1.
  5. Out of scope and where it went:
  6. Landing terms: ungoverned, default tier, Clause-②: yes (widening), Security-touching: yes. A same-head at-tier PASS with S1 and S2 closed is owed, then ACCEPT. The area lands it.

…ce holds under; pin an administrator editing and clearing another's setting

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Final head after rework round 1: 98cbc476025ff17adedde53e62f0cb8bcdbba110 (L1 7180149059, contract record 7180135740). Main was not merged again.

  • S1, closed. The changeset's isolation bullet and the object's docblock now give the posture condition. Under isolated, the tenant wall (ADR-0095 D1) confines reads and writes to the caller's organization. Under single there is no wall, and group walls by membership (ADR-0105 D1). The wording matches the PR body's acceptance note.
  • N1, closed. The changeset now says "No reader ships in this change; the quantity display card (Units of measure R1: show a quantity with its unit label #35490) will read it."
  • S2, closed. New real-stack cases pin the organization_admin line across creators. An admin changes and deletes a setting the owner created, and the owner does the same to one the admin created. The effective-permission map keeps allowDelete and grants no modifyAllRecords. Ablating the line to allowEdit: false, allowDelete: false turned 8 of 15 red, the new cases among them. The line was then restored, with the blob equal to HEAD.
  • Affected tests re-run: default-permission-sets.standard-unit-setting.integration.test.ts 15 passed (15); sys-standard-unit-setting.object.test.ts 14 passed (14).
  • CI on this head: 60 success, 13 skipped, 0 failed, 0 pending.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 98cbc47 · 2026-11-26T02:37Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 98cbc476025ff17adedde53e62f0cb8bcdbba110
Local-runs: none
Scope: packages/spec/src/system/constants/platform-object-names.ts + packages/platform-objects/src/system/sys-standard-unit-setting.object.ts, packages/platform-objects/src/system/sys-standard-unit-setting.object.test.ts, packages/platform-objects/src/system/index.ts, packages/platform-objects/src/plugin.ts, packages/platform-objects/src/apps/setup-nav.contributions.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts, packages/cli/src/utils/organization-ownership-inventory.ts, packages/cli/test/connect-agent-both-halves-wire.pin.test.ts, scripts/platform-object-tenancy-census.json, .changeset/35498-standard-unit-setting.md (translation bundles spot-checked on the earlier head and untouched since)
Security-touching: yes
Rule-change-verified: none

① Derived judgments

This record is a fresh review of the new head. It rests on the whole-diff read made at 03e453e3d3076da4777dd5c288232b81561ce9a2 plus the delta from that head to this one (3 files, +38/−5: the changeset, the object's docblock, the integration test), the area's comment 7180963343, and the check-runs on this head. The delta changes no schema, no grant line, no registry name and no generated file, so every judgment below that the delta does not touch stands as read on the earlier head.

Check-runs on this head: every run is success or skipped, none failed or pending. Test Core (all ten shards), TypeScript Type Check, Lint & Repo Gates, Governed Surface Queue Guard and Spec property liveness are success. On the names that ran twice, Check Changeset and PR-body guards are success on the newer run; Auto Label and Check PR Size are skipped on the newer run.

  • PLATFORM_OBJECTS_BY_PACKAGE['platform-objects'] gains sys_standard_unit_setting (the one hits path). Right: add-only, in sort order; the name becomes a reference target. A widening, nothing removed or re-meant. Unchanged by the delta.
  • New platform object, accept set. code text, max 3, admitted by an anchored, case-sensitive pattern built from Object.keys(STANDARD_UNITS); decimal_places required, 0..UNIT_DECIMAL_PLACES_MAX (12), scale 0; unique code per organization; code immutable by an update-only rule in sys_unit's spelling. Right against the sys_unit.decimal_places precedent and ADR-0158 L4. Unchanged by the delta (the object file's only hunk is the Tenancy docblock bullet).
  • code as text plus a format rule, not a select. Right, declared (7179529249), pinned.
  • Clear = delete; decimal_places required. Right, declared (7178144166), pinned.
  • member_default: read only, no write bit, no row policy. Right for least privilege; pinned (exact member list, three 403 refusals, stored row unchanged).
  • organization_admin: explicit line, create/edit/delete, no superuser bits. Right, and now pinned across creators: see S2 below.
  • external_default: no line. Right as read. Still unpinned: N2.
  • Tenancy, census, inventory. Right and mutually consistent. Unchanged by the delta.
  • Cross-organization isolation under isolated. Right, with positive controls. Unchanged by the delta.
  • Organization delete. Right as pinned (409 DELETE_RESTRICTED naming this object, then success).
  • Setup nav entry. Right. Unchanged by the delta.
  • Clause-②: yes (widening). Right.
  • Metadata-protocol: none. Right: nothing a metadata author writes is added, removed or re-meant; sys_unit joined the same registry under none.

② Semver level

patch on @objectstack/spec, @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/cli — right for a non-protocol widening (AGENTS.md Post-Task step 3). The delta does not touch the changeset's front matter or its two declaration lines; both still agree with the PR body. Check Changeset is success on its newer run.

Changeset, sentence by sentence, on this head:

  • Lead paragraph: true, unchanged.
  • "Every member reads … External members get no read": true (external half by reading only, N2).
    S1: closed. The bullet now reads: organization_id is injected and stamped on every row; under isolated the tenant wall confines every read and write to the caller's organization; single raises no wall; group walls by membership, so a member of several organizations can read each one's settings. Checked against ADR-0105 D1 posture by posture: isolated is organization_id = activeOrganizationId, true; single is "none between organizations", true; group is organization_id IN accessible_org_ids, a union over memberships, true. "Stamped on every row" is also true in every posture on the code as it stands (the engine's write target is the active organization "in every posture", and a system write with no organization is stamped with the derivable one or refused, ADR-0131 D9). That corrects one line of my earlier record, which said single rows are unstamped: that came from the ADR-0105 D1 table's older "Stamping: none" cell, not from the code. The object's Tenancy docblock bullet carries the same three-posture wording and is true the same way. The member_default comment in default-permission-sets.ts still says Layer 0 "already confines a read"; it copies sys_unit's comment word for word and I leave it as that precedent's wording, no finding.
  • "Every set, change and clear is written to sys_audit_log …": true where plugin-audit is mounted; pinned.
    N1: closed. The line now reads "No reader ships in this change; the quantity display card (Units of measure R1: show a quantity with its unit label #35490) will read it."
  • "Like an exchange rate … refused (DELETE_RESTRICTED) until its settings are deleted": true for this object as pinned; the exchange-rate half is taken from the area's amendment, not re-derived.

③ Boundary flags

Dev deviations (os-dev-report 7179477079), each answered as on the earlier head: clear = delete (7178144166); code text plus format rule (7179529249); the one extra file, a nav count pin (7179529249); Clause-②: yes (widening) right; commit trailer pair of no contract effect. open_questions: empty.

N4 (nit) — Fixes #35498 closes the card with two Done-when lines not true at merge: "Display (#35490) reads the setting" and "ADR-0158 records the answer" (row 7179515770 on #37245, ordered after this merge). Both are tracked and the area accepted the close (7179529249). Until that row lands, ADR-0158 on main still reads "have no home: Open item 10" and "a ruling is owed"; the seat should not let the row slip a week.

Rework comment 7180963343: its three closures are each confirmed against the delta (S1 and N1 in ②, S2 in ④). Its ablation claim (the organization_admin line set to allowEdit: false, allowDelete: false turning 8 of 15 red, then restored) is the area's report; not re-run here, and the head's tree carries the line as reviewed (the delta does not touch default-permission-sets.ts).

Out-of-scope finding the dev reported (pnpm check:platform-checklist red on main for FlowItemMoreMenu): not this diff; with the seat to file or dedupe.

packages/spec/scripts/lib/platform-catalog.ts is on the amended surface and not in the diff. Right for now: nothing reaches this object until the reader ships. #35490 owes the catalog row, or a decision that it stays out.

For #35490 (the reader): under group a reader can see more than one organization's row for one code, and under single every organization's rows are visible, so the reader must pick the row by the record's or the active organization, not "the row for the code". The L4 clamp to the field's scale is still owed there; a stored 12 is legal here by design.

SQL push-down (Prime Directive 5): the delta adds no query, id materialisation or in-app join; nor does the rest of the diff. Nothing to find.

④ Design judgment

packages/spec/src/system/constants/platform-object-names.ts — holds: one add-only name, registered by the package the map names as owner.

Implementing files against the contract (ruling 7008551416; ADR-0158 L4 unchanged):

  • sys-standard-unit-setting.object.ts — agrees. The delta is docblock only; no field, index, rule, view or enable key moves.
  • default-permission-sets.ts — agrees, least privilege on both lines; untouched by the delta.
    S2: closed. The new block creates a setting as one persona and changes then deletes it as the other, in both directions: owen (owner) creates MTR, carol (administrator) updates and deletes it; carol creates CMT, owen updates and deletes it. Each insert goes through the creator's own execution context (insert(as[creator], …)), not a system context, so the row really is another person's; each step is asserted on stored state (decimal_places 2 then 1, then no row for the code). A plain member cannot be the creator here by design (no create bit), so administrator and owner are the right pair. A third case reads the effective permission map for both personas: read, create, edit and delete are kept and modifyAllRecords is not granted, which pins that the cross-creator reach does not come from a superuser bit. The codes do not collide with the rest of the suite: MTR is deleted before the member case that asserts no MTR row is stored.
    N2 (nit) — "External members get no read" is asserted in the changeset, the PR body and the member_default comment and exercised by no persona in the suite.
    N3 (nit) — the cross-organization write test swallows both outcomes and asserts stored state only. Enough for isolation; it leaves unpinned whether the caller meets a refusal or a silent no-op.
    N5 (nit) — nav_standard_unit_settings reuses the ruler icon of the entry directly above it.
  • Integration test — 15 cases on this head by the PR body and the rework comment; Test Core is success on the head. Nothing in the delta weakens an existing assertion: it is one added describe block, no edit to the earlier cases.

Nothing new breaks: the delta is prose in two files and added test cases in the third, and every check-run on the head is green or skipped.

No must-fix and no should-fix remain. Open: N2, N3, N4, N5, all nits.

Implemented-by: claude/project-thread-yzpuwp
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 98cbc476025ff17adedde53e62f0cb8bcdbba110
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 48 files, Fixes #35498. The delta since 03e453e3 touches 3 files (+38/−5): the changeset, the object docblock and the integration test.
  2. Rework closed (contract record 7181014432):
    • S1: the posture condition now reads true for isolated, single and group under ADR-0105 D1. Every row is stamped with the active organization in every posture.
    • S2: the new pins are cross-creator in both directions. The owner creates and the admin updates and deletes, and the reverse. Each insert runs in its creator's context and each step asserts stored state. A third case pins full rights without modifyAllRecords.
    • N1: the changeset now says the display "will read it".
  3. Gates: check-runs at 98cbc47602: 60 success, 13 expected skip, 0 failed.
  4. Accepted deviations:
  5. Out of scope and where it went: the Units of measure R1: show a quantity with its unit label #35490 reader items are on the card (7180167601). ADR-0158's answer goes to ADR revisions, week of 2026-11-25: rolling checklist of ADR text out of step with main (one governed PR) #37245 row 7179515770. The dead checklist anchor goes to Platform checklist: studio-authoring.first-run-loop still walks the removed Studio landing and Home build chip #37344.
  6. Landing terms: ungoverned, default tier, Clause-②: yes (widening), Security-touching: yes. L2 at CONTRACT_REVIEW_TIER: PASS, comment 7181014432, same head, no must-fix, no should-fix. The area lands it via landing-operations §B.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Landing · area o5-D · 2026-11-26T02:41Z · on L1 ACCEPT 7181024389 and contract review PASS 7181014432 at 98cbc476025ff17adedde53e62f0cb8bcdbba110

Probe Reading
check-governed-merges.mjs --pr 37389 NOT governed · 0 of 48 paths · 1301 changed lines ≤ 3000
landing-k.mjs --pr 37389 K = 2 < 15 · no locale pack · no shared book moved

State: ready + auto-merge now; on MERGED the area closes out #35498 (Fixes) and the ADR-0158 row 7179515770 on #37245 follows.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 02:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit a0b01fa Nov 26, 2026
74 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-yzpuwp branch November 26, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Units of measure R1: an organization setting for how many decimal places each standard unit displays

2 participants